﻿class util.FrameTracker extends MovieClip {
	//////////////////////////////////
	// This class is used with linkage ID's
	// in conjunction with the MVC separation
	// when the corresponding clip is placed on the stage
	// it will broadcast an event when it reaches t
	private function FrameTracker() {
		this.onFrameChanged();
	}
	///////////////////////////////////
	// sets up the linkage between this class and the onstage objecr
	// should be called early on.
	public static function setupLinkage() : Void {
		trace("*****************FrameTrackersetupLinkage************************");
		trace("*****************FrameTrackersetupLinkage************************");
		trace("*****************FrameTrackersetupLinkage************************");
		trace("*****************FrameTrackersetupLinkage************************");
		Object.registerClass("FrameTracker", FrameTracker);
	}
	public function onFrameChanged() : Void {
		trace("*****************************************");
		trace("**parent "+this._parent+"***** "+this._name+" ***** "+this._parent._currentframe+"*****************************");
		trace("*****************************************");
		var args = new Object();
		args.parentname = String(this._parent._name);
		args.name = String(this._name);
		args.currentframe = Number(this._parent._currentframe); 
		//kinda hackish not using a concrete class
		_global.rootCore.createAndAddEvent("FRAMETRACKER", args);
		_global.rootCore.dispatchEvents();
	}
}
